<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">动态导入</button>
    <script type="module">
        import {a,res} from "/demo3/add.js"
        // import{b} from "./sub.js"
        console.log(a)
        console.log(res)
        let btn=document.getElementById("btn")
        btn.addEventListener("click",()=>{
            let sub=import("./sub.js")
            console.log(sub)
            sub.then((module)=>{
                console.log(module.b)
                console.log(module.compute())
            })
        })
    </script>
</body>
</html>